<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>   
<%@ taglib prefix="pm" uri="/page-tags"%>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="../page/style/content.css" rel="stylesheet" type="text/css" />
<script src="../page/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../page/js/layer/layer.js" type="text/javascript"></script>
<script src="../page/js/toast.js" type="text/javascript"></script>
<script src="../page/js/common.js" type="text/javascript"></script>
<link type="text/css" href="../page/style/datepicker/ui.all.css" rel="stylesheet" />
<link type="text/css" href="../page/style/datepicker/style.css" rel="stylesheet" />
<script type="text/javascript" src="../page/js/datepicker/ui.core.js"></script>
<script type="text/javascript" src="../page/js/datepicker/ui.datepicker.js"></script>
<script type="text/javascript" src="../page/js/datepicker/ui.datepicker-zh_CN.js"></script>

<script type="text/javascript">
	
	$(function(){
		datePicker('#fromDate','zh_CN');
		datePicker('#toDate','zh_CN');
	});
	
	function datePicker(pickerName,locale) {
		$(pickerName).datepicker($.datepicker.regional[locale]);
		$(pickerName).datepicker('option', 'changeMonth', true);//月份可调
		$(pickerName).datepicker('option', 'changeYear', true);//年份可调
	}
	
	function checkClick() {
		var fromDate = $("#fromDate").val();
		var toDate = $("#toDate").val();
		if (fromDate == "") {
			$("#alertInfo").text("*请选择开始日期");
		} else if (toDate == "") {
			$("#alertInfo").text("*请选择结束日期");
		} else if (fromDate > toDate) {
			$("#alertInfo").text("*开始日期不能大于结束日期");
		} else {
			document.location.href = "log-record-manage.action?fromDate=" + fromDate + "&toDate=" + toDate;
		}
	}
	
	function removeLog(id)
	{
		$.post("log-record-remove.action",{"logId":id},
				function(data) {
					promptRedirect("删除成功");
			}, "json");
	}
	
</script>

</head>
<body>
	<s:include value="../right_top.jsp"/>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="35">
							<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
								<tr>
									<td width="40" align="right"><img src="../page/images/ico07.gif" width="20" height="18" /></td>
									<td>
										从<input name="visitResult.visitDate" id="fromDate" class="text" type="text" size="10" onfocus="cleanInfo()"/>
										到<input name="visitResult.visitDate" id="toDate" class="text" type="text" size="10" onfocus="cleanInfo()"/>
										<input type="button" class="query-button" value="查 询" onclick="checkClick();"/>
										<span id="alertInfo" style="color: red;"></span>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
    		<td>
    			<table id="subtree1" width="100%" border="0" cellspacing="0" cellpadding="0">
        		<tr>
          			<td>
          				<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              				<tr>
               					<td height="40" class="font42">
               					<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">
					                  <tr>
 						                  <td height="20" colspan="5" align="center" bgcolor="#EEEEEE"class="tablestyle_title">日志列表</td>
                    				  </tr>
					                  <tr>
					                    <td width="10%" align="center" bgcolor="#EEEEEE">用户</td>
					                    <td width="25%" align="center" bgcolor="#EEEEEE">模块</td>
					                    <td width="25%" align="center" bgcolor="#EEEEEE">操作</td>
					                    <td width="25%" align="center" bgcolor="#EEEEEE">记录时间</td>
					                    <td width="5%" align="center" bgcolor="#EEEEEE">管理</td>
					                  </tr>
					                  <s:if test="logs.size() > 0">
						                  <s:iterator value="logs">
											  <tr>
												<td bgcolor="#FFFFFF"><div align="center"><s:property value="name"/></div></td>
							                    <td bgcolor="#FFFFFF"><div align="center"><s:property value="moduleName"/></div></td>
							                    <td bgcolor="#FFFFFF"><div align="center"><s:property value="operate"/></div></td>
							                    <td bgcolor="#FFFFFF"><div align="center"><s:date name="optionDate" /></div></td>
							                    <td bgcolor="#FFFFFF"><div align="center">
							                    	<s:a href="javascript:removeLog(%{id})"><img src="../page/images/system/remove.png" title="删除"/></s:a>
							                  	</div></td>
							                  </tr>
						                  </s:iterator>
					                  </s:if>
					                  <s:else>
					                  	 <tr>
					                  		<td bgcolor="#FFFFFF" colspan="5">暂无数据</td>
					                  	 </tr>
					                  </s:else>
                				</table>
                			</td>
             			 </tr>
            		</table>
            	</td>
        	</tr>
      </table>
      <s:include value="../page.jsp" />
      </td>
  </tr>
</table>
	
</body>
</html>